package com.gitee.booting.dspi.example.provider;

import com.gitee.booting.dspi.Dspi;
import com.gitee.booting.dspi.example.api.IHello;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

@Dspi(names = {"hidden"})
public class HiddenHello implements IHello {
    @Override
    public String hello() {
        return "I'm hidden!";
    }

    @Override
    public Map<String, String> metadata() {
        return Collections.singletonMap("about", "A hidden IHello implementation for test only!");
    }

    @Override
    public Map<String, String> metadata(Map<String, String> whatever) {
        Map<String, String> r = new HashMap<>(metadata());
        if (null != whatever) {
            r.putAll(whatever);
        }
        return r;
    }
}
